import request from '@/utils/request'

/**
 * 获取部门列表
 * @returns 
 */
export function getDepartment(){
    return request({
        // 配置url,method,参数,data,params
        url:'/company/department',
    })
}

/**
 * 新增子部门
 * @returns 
 */
 export function addDepartment(data){
    return request({
        // 配置url,method,参数,data,params
        url:'/company/department',
        method:'post',
        data
    })
}

/**
 * 获取部门详情数据
 * @returns 
 */
 export function getDepartmentDetail(id){
    return request({
        // 配置url,method,
        url:`/company/department/${id}`,
    })
}

/**
 * 编辑部门
 * @returns 
 */
 export function updateDepartment(data){
    return request({
        // 配置url,method,
        url:`/company/department/${data.id}`,
        method:'put',
        data
    })
}

/**
 * 删除部门
 * @returns 
 */
 export function DelDepartment(id){
    return request({
        // 配置url,method,
        url:`/company/department/${id}`,
        method:'delete',
    })
}